package com.example.myapplication.bean;

import android.content.Context;
import android.widget.Toast;

public class BaseGsonData<T> {
    private String success;
    private String massage;
    private T data;

    public BaseGsonData(String success, String massage, T data) {
        this.success = success;
        this.massage = massage;
        this.data = data;
    }

    public BaseGsonData() {
    }

    public String getSuccess() {
        return success;
    }

    public void setSuccess(String success) {
        this.success = success;
    }

    public String getMassage() {
        return massage;
    }

    public void setMassage(String massage) {
        this.massage = massage;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "BaseGsonBean{" +
                "success='" + success + '\'' +
                ", massage='" + massage + '\'' +
                ", data=" + data +
                '}';
    }

    public boolean isSuccess() {
        if (success.equals("true")) {
            return true;
        }else {
            return false;
        }
    }

    public void toastMassage(Context context) {
        Toast.makeText(context, massage, Toast.LENGTH_SHORT).show();
    }
}
